import {createApp} from 'vue'
import App from './App.vue'


import '@/styles/index.scss'

const app = createApp(App)



//npm i element-plus @element-plus/icons-vue --save
import 'element-plus/dist/index.css'
import ep from 'element-plus'


//国际化 zhCN
import locale from 'element-plus/es/locale/lang/zh-cn'

app.use(ep, {locale})

import i18n from '@/i18n'

app.use(i18n)
// 安装icons组件
// npm install @element-plus/icons-vue
import * as epi from '@element-plus/icons-vue'

for (const [key, component] of Object.entries(epi)) {
    app.component(key, component)
}


//全局注册组件
import 'virtual:svg-icons-register'
import svgicon from '@/components/svgicon.vue'

app.component('SvgIcon', svgicon)


//状态管理 pinia
// npm i pinia pinia-plugin-persistedstate --save
import {createPinia} from 'pinia'
import persistedstate from 'pinia-plugin-persistedstate'

const pinia = createPinia()
pinia.use(persistedstate)
app.use(pinia)

import router from './router'
app.use(router)

import '@/router/permission'

app.mount('#app')
